/*
 * 
 * 
 * 
 */
package com.hboxs.asl;

import com.hboxs.asl.entity.BaseEntity;
import org.hibernate.search.bridge.builtin.StringBridge;

/**
 * ProductCategory类型转换
 */
public class ProductFieldBridge extends StringBridge {

    @Override
    public String objectToString(Object object) {
        try {
            Long id = ((BaseEntity) object).getId();
            return String.valueOf(id);
        } catch (Exception e) {
            // default to zero for null values or other problems
            return "0";
        }
    }

    @Override
    public Object stringToObject(String stringValue) {
        return stringValue;
    }

}